﻿using FreeSql.DataAnnotations;

namespace KrasDD.Models
{

    [JsonObject(MemberSerialization.OptIn), Table(Name = "[innovator].[PROPERTY]", DisableSyncStructure = false)]
    public partial class PROPERTY : Relationships<ITEMTYPE>
    {

        [JsonProperty, Column(StringLength = 64)]
        public string BEHAVIOR { get; set; }

        [JsonProperty]
        public int? CATEGORY_BY { get; set; }

        [JsonProperty, Column(StringLength = 512)]
        public string CLASS_PATH { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string COLUMN_ALIGNMENT { get; set; } = "left";

        [JsonProperty]
        public int? COLUMN_WIDTH { get; set; }

        [JsonProperty, Column(DbType = "char(32)")]
        public string DATA_SOURCE { get; set; }

        [JsonProperty, Column(StringLength = 64, IsNullable = false)]
        public string DATA_TYPE { get; set; }

        [JsonProperty, Column(StringLength = 32)]
        public string DEFAULT_SEARCH { get; set; }

        [JsonProperty, Column(StringLength = 128)]
        public string DEFAULT_VALUE { get; set; }

        [JsonProperty, Column(DbType = "char(32)")]
        public string FOREIGN_PROPERTY { get; set; }

        [JsonProperty, Column(StringLength = -2)]
        public string HELP_TEXT { get; set; }

        [JsonProperty, Column(StringLength = 80)]
        public string HELP_TOOLTIP { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool IS_FEDERATED { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool IS_HIDDEN { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool IS_HIDDEN2 { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool IS_INDEXED { get; set; }

        [JsonProperty, Column(DbType = "bit", IsNullable = false)]
        public bool IS_KEYED { get; set; } = false;

        [JsonProperty, Column(DbType = "bit")]
        public bool IS_MULTI_VALUED { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool IS_REQUIRED { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string ITEM_BEHAVIOR { get; set; } = "float";

        [JsonProperty]
        public int? KEYED_NAME_ORDER { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string LABEL { get; set; }

        [JsonProperty]
        public int? MAX_RANGE { get; set; }

        [JsonProperty]
        public int? MIN_RANGE { get; set; }

        [JsonProperty, Column(StringLength = 32, IsNullable = false)]
        public string NAME { get; set; }

        [JsonProperty]
        public int? ORDER_BY { get; set; }

        [JsonProperty, Column(StringLength = 512)]
        public string PATTERN { get; set; }

        [JsonProperty]
        public int? PREC { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool RANGE_INCLUSIVE { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool READONLY { get; set; } = false;

        [JsonProperty]
        public int? SCALE { get; set; }

        [JsonProperty]
        public int? SORT_ORDER { get; set; }

        [JsonProperty]
        public int? STORED_LENGTH { get; set; }

        [JsonProperty, Column(DbType = "bit")]
        public bool TRACK_HISTORY { get; set; }


        #region 外键 => 导航属性，ManyToOne/OneToOne

        [Navigate("SOURCE_ID")]
        public virtual ITEMTYPE ITEMTYPE { get; set; }

        #endregion

        #region 外键 => 导航属性，OneToMany

        #endregion
    }

}
